package com.ucode.wap.cgms.controller;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.ucode.cgms.service.CgmsCompanionCategoryService;
import com.ucode.cgms.service.CgmsGiftService;
import com.ucode.model.cgms.CgmsGift;
import com.ucode.model.cgms.enums.CgmsGiftStateEnum;
import com.ucode.model.cgms.vo.CgmsGiftVO;
import com.ucode.tool.base.ResponseResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Tag(name = "移动端 - 陪玩社区系统 - 陪玩礼物")
@RestController
@RequestMapping("/cgms/gift")
@Validated
public class ApiCgmsGiftController {

    private static Log log = LogFactory.get();
    @Resource
    private CgmsCompanionCategoryService cgmsCompanionCategoryService;
    @Resource
    private CgmsGiftService cgmsGiftService;

    @Operation(summary = "列表")
    @GetMapping(value = "/list")
    public ResponseResult<List<CgmsGift>> list() {
        Map<String,Object> condition = new HashMap<>();
        condition.put("status", CgmsGiftStateEnum.ON_SHELF.getState());
        condition.put("deltag",false);
        List<CgmsGift> list = cgmsGiftService.queryObjectForList(condition,0);
        return ResponseResult.success(list);
    }

    @GetMapping(value = "/details/{id}")
    @Parameter(description="主键ID",name = "id", required = true,in = ParameterIn.PATH,example = "1024")
    @Operation(summary = "服务礼物信息详情")
    public ResponseResult<CgmsGiftVO> getDetails(@PathVariable(name="id",required=true) Long id) {

        return ResponseResult.success();
    }


}
